<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="tutorial.css">
<TITLE>
How do I use ECLiPSe libraries in my programs?
</TITLE>
</HEAD>
<BODY >
<A HREF="tutorial009.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="tutorial003.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial011.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc17">2.7</A>&nbsp;&nbsp;How do I use ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> libraries in my programs?</H2>
<A NAME="@default9"></A>

A number of files containing library predicates are supplied with the
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> system. They are usually installed in an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>
library directory. These predicates are either loaded automatically
by ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> or may be loaded &#8220;by hand&#8221;.<BR>
<BR>
During the execution of an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> program, the system may
dynamically load files containing library predicates. When this
happens, the user is informed by a compilation or loading message. It
is possible to explicitly force this loading to occur by use of the
<A HREF="../bips/kernel/compiler/lib-1.html"><B>lib/1</B></A><A NAME="@default10"></A> or
<A HREF="../bips/kernel/modules/use_module-1.html"><B>use_module/1</B></A><A NAME="@default11"></A>
predicates. E.g. to load the library called <TT>lists</TT>, use one of
the following goals:
<BLOCKQUOTE CLASS="quote">
<PRE CLASS="verbatim">
:- lib(lists)
:- use_module(library(lists))
</PRE></BLOCKQUOTE>
This will load the library file unless it has been already loaded. In
particular, a program can ensure that a given library is loaded when
it is compiled, by including an appropriate directive in the source,
e.g. <TT>:- lib(lists).</TT><BR>
<BR>
<HR>
<A HREF="tutorial009.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="tutorial003.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial011.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
